package com.example.coursaccino;

import android.os.Bundle;
import android.os.Handler;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;

public class SplashActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);       
        
        Handler handler = new Handler();
 
        // run a thread after 2 seconds to start the home screen
        handler.postDelayed(new Runnable() {
 
            @Override
            public void run() { 
                // make sure we close the splash screen so the user won't come back when it presses back key 
                finish();
                // start the home screen 
                Intent intent = new Intent(SplashActivity.this, ProfMainActivity.class);
                System.out.println("Yo");
                startActivity(intent);
            }
 
        }, 1000); // time in milliseconds (1 second = 1000 milliseconds) until the run() method will be called    
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_splash, menu);
        return true;
    }
}